<%@ page import="dao.CollegeDao" %>
<%@ page import="entity.College" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: DELL
  Date: 2024/10/30
  Time: 14:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>专业信息录入</title>
</head>
<body>
    <form action="major_add_save.jsp">
        <br> 专业名称:<input type="text" name="name" />
        <br> 所属学院:
            <select name="college_id" >
               <%
                //从学院信息表中读取所有记录，生成<option></option>
                List<College> list  = new CollegeDao().getAll();
                for(College obj:list){
                  out.println("<option value='"+obj.getId()+"' >"
                                + obj.getName()
                             +"</option>");
                }
               %>
            </select>
        <br> <input type="submit" value="提交" />
    </form>
</body>
</html>
